package com.zhuoshi.service.impl;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;

import com.zhuoshi.entity.AuthorityCustom;
import com.zhuoshi.mapper.AuthorityCustomMapper;
import com.zhuoshi.service.AuthorityService;

public class AuthorityServiceImpl implements AuthorityService{

	@Autowired
	private AuthorityCustomMapper authorityCustomMapper;
		
	@Override
	public List<AuthorityCustom> selectClientMenu(Integer rid) {
		// TODO Auto-generated method stub
		 List<AuthorityCustom> selectClientMenu = authorityCustomMapper.selectClientMenu(rid);
//		 for (AuthorityCustom authorityCustom : selectClientMenu) {
//			 authorityCustom.setChildren(authorityCustomMapper.selectChildrenMenu(authorityCustom.getPid()));						 
//		}
		 
		 return selectClientMenu;
	}

	@Override
	public List<AuthorityCustom> selectChildrenMenu(Integer pid) {
		return authorityCustomMapper.selectChildrenMenu(pid);
	}

	@Override
	public List<AuthorityCustom> selectMenu(AuthorityCustom authorityCustom) {
		authorityCustom.setPid(0);
		System.out.println(authorityCustom.getRid());
		return authorityCustomMapper.selectMenu(authorityCustom);
		
	}
	
	
	

}
